<template>

    <el-dialog v-model="$store.state.homeview.dialogFormVisible" title="请输入修改内容">
        <el-form :model="form" :label-width="formLabelWidth">
            <el-form-item label="姓名" :label-width="formLabelWidth">
                <el-input v-model="form.name" prop="name" />
            </el-form-item>
            <el-form-item label="详细地址" :label-width="formLabelWidth">
                <el-input v-model="form.region" prop="region " />
                <!-- <el-option label="Zone No.1" value="shanghai" />
                    <el-option label="Zone No.2" value="beijing" /> -->

            </el-form-item>
        </el-form>
        <template #footer>
            <span class="dialog-footer">
                <el-button @click="toggleDialog(0)">取消</el-button>
                <el-button type="primary" @click="toggleDialog(1)">确定</el-button>
            </span>
        </template>
    </el-dialog>
</template>
<script setup lang="ts">
import { reactive, ref } from 'vue'
//引用useStore
import { useStore } from "vuex";
const store = useStore()
// const dialogTableVisible = ref(false)
// const dialogFormVisible = ref(false)
const formLabelWidth = '140px'
const form = reactive({
    name: '',
    region: '',
    date1: '',
    date2: '',
    delivery: false,
    type: [],
    resource: '',
    desc: '',
})

let toggleDialog = (num: Number) => {
    // 调用vuex修改弹出框状态
    store.commit("SET_DIALOG")
    if (num == 0) {
        //用户点击了取消
    } else {
        //   用户点击了确定
        //   得到输入框的值
        console.log(form.name + "---" + form.region);
    }
}
</script>
<style scoped>
.el-button--text {
    margin-right: 15px;
}

.el-select {
    width: 300px;
}

/* .el-input {
    width: 300px;
} */

.dialog-footer button:first-child {
    margin-right: 10px;
}
</style>